package com.silvtar.sync.ui;

import java.awt.BorderLayout;
import java.awt.Dimension;

import javax.swing.JPanel;
import javax.swing.JTabbedPane;
import javax.swing.SwingConstants;

import com.silvtar.sync.controller.SilverySyncInit;

public class MainPanel extends JPanel {

    /**
     * 
     */
    private static final long serialVersionUID = 1L;

    // 自定义部分
    private PairingPanel      pairingPanel;
    private ScanPanel         scanPanel;
    private ServicePanel      servicePanel;
    private SyncPanel         syncPanel;

    /**
     * Create the panel.
     */
    public MainPanel(SilverySyncInit ssInit) {
        this.setPreferredSize(new Dimension(400, 400));
        JTabbedPane tabbedPane = new JTabbedPane(SwingConstants.TOP);
        tabbedPane.setPreferredSize(new Dimension(320, 396));
        add(tabbedPane, BorderLayout.CENTER);
        
        // 自定义初始化部分
        pairingPanel = new PairingPanel(ssInit);
        scanPanel = new ScanPanel();
        servicePanel = new ServicePanel(ssInit);
        syncPanel = new SyncPanel(ssInit);

        // 以下为选项卡部分
        tabbedPane.addTab("配对", pairingPanel);
        tabbedPane.addTab("扫描", scanPanel);
        tabbedPane.addTab("服务", servicePanel);
        tabbedPane.addTab("现在同步", syncPanel);
    }

}
